home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / bounce_c.swf / scripts / frame_50 / DoAction.as
Text File  |  2010-11-09  |  4KB  |  143 lines

  1. stop();
  2. removeAllClips();
  3. _root.onEnterFrame = function()
  4. {
  5.    back3._x = -440 + _xmouse / 1.5;
  6.    back2._x = -300 + _xmouse / 4;
  7.    back1._x = -230 + _xmouse / 8;
  8. };
  9. master_score = 0;
  10. var c = 1;
  11. while(c <= 5)
  12. {
  13.    master_score += _root["stage_score" + c];
  14.    c++;
  15. }
  16. master_rank = master_score / 5;
  17. if(_root.master_rank > _root.score_level1)
  18. {
  19.    overall_rank.crush_rank.gotoAndStop("r_m");
  20. }
  21. else if(_root.master_rank > _root.score_level2)
  22. {
  23.    overall_rank.crush_rank.gotoAndStop("r_a");
  24. }
  25. else if(_root.master_rank > _root.score_level3)
  26. {
  27.    overall_rank.crush_rank.gotoAndStop("r_b");
  28. }
  29. else if(_root.master_rank > _root.score_level4)
  30. {
  31.    overall_rank.crush_rank.gotoAndStop("r_c");
  32. }
  33. else if(_root.master_rank > _root.score_level5)
  34. {
  35.    overall_rank.crush_rank.gotoAndStop("r_d");
  36. }
  37. else if(_root.master_rank > _root.score_level6)
  38. {
  39.    overall_rank.crush_rank.gotoAndStop("r_e");
  40. }
  41. else if(_root.master_rank > 0)
  42. {
  43.    overall_rank.crush_rank.gotoAndStop("r_f");
  44. }
  45. else
  46. {
  47.    overall_rank.crush_rank.gotoAndStop("r_n");
  48. }
  49. menuButton.onRollOver = function()
  50. {
  51.    this._xscale = 120;
  52.    this._yscale = 120;
  53. };
  54. menuButton.onRollOut = function()
  55. {
  56.    this._xscale = 100;
  57.    this._yscale = 100;
  58. };
  59. menuButton.onPress = function()
  60. {
  61.    _root.gotoAndStop("menuScreen");
  62. };
  63. var i = 1;
  64. while(i <= 5)
  65. {
  66.    _root["levelSelect" + i].j = i;
  67.    _root["levelSelect" + i]._xscale = 9;
  68.    _root["levelSelect" + i]._yscale = 9;
  69.    _root["levelSelect" + i].lineMap.gotoAndStop(i);
  70.    _root["levelSelect" + i].houseMap.gotoAndStop(i);
  71.    _root["levelSelect" + i].caveBackground._alpha = 100;
  72.    if(_root["stage_score" + (i - 1)] > 0 || i == 1)
  73.    {
  74.       _root["levelSelect" + i].black_mask._alpha = 0;
  75.    }
  76.    else
  77.    {
  78.       _root["levelSelect" + i].black_mask._alpha = 50;
  79.    }
  80.    _root["levelSelect" + i].onPress = function()
  81.    {
  82.       if(_root["stage_score" + (this.j - 1)] > 0 || this.j == 1)
  83.       {
  84.          _root.currentLevel = this.j;
  85.          _root.gotoAndStop("levelStart");
  86.       }
  87.    };
  88.    _root["levelSelect" + i].onRollOver = function()
  89.    {
  90.       this.play();
  91.       this._xscale = 10;
  92.       this._yscale = 10;
  93.       if(_root["stage_score" + this.j] > 0 || this.j == 1)
  94.       {
  95.          _root.stage_score = _root["stage_score" + this.j];
  96.          _root.stage_select.gotoAndStop("stage_detail");
  97.          if(_root.stage_score > _root.score_level1)
  98.          {
  99.             _root.stage_select.crush_rank.gotoAndStop("r_m");
  100.          }
  101.          else if(_root.stage_score > _root.score_level2)
  102.          {
  103.             _root.stage_select.crush_rank.gotoAndStop("r_a");
  104.          }
  105.          else if(_root.stage_score > _root.score_level3)
  106.          {
  107.             _root.stage_select.crush_rank.gotoAndStop("r_b");
  108.          }
  109.          else if(_root.stage_score > _root.score_level4)
  110.          {
  111.             _root.stage_select.crush_rank.gotoAndStop("r_c");
  112.          }
  113.          else if(_root.stage_score > _root.score_level5)
  114.          {
  115.             _root.stage_select.crush_rank.gotoAndStop("r_d");
  116.          }
  117.          else if(_root.stage_score > _root.score_level6)
  118.          {
  119.             _root.stage_select.crush_rank.gotoAndStop("r_e");
  120.          }
  121.          else
  122.          {
  123.             _root.stage_select.crush_rank.gotoAndStop("r_f");
  124.          }
  125.       }
  126.       else if(_root["stage_score" + (this.j - 1)] > 0 || this.j == 1)
  127.       {
  128.          _root.stage_select.gotoAndStop("stage_click");
  129.       }
  130.       else
  131.       {
  132.          _root.stage_select.gotoAndStop("stage_locked");
  133.       }
  134.    };
  135.    _root["levelSelect" + i].onRollOut = function()
  136.    {
  137.       this._xscale = 9;
  138.       this._yscale = 9;
  139.       _root.stage_select.gotoAndStop("stage_roll");
  140.    };
  141.    i += 1;
  142. }
  143.